﻿using IOA.MES.DataAccess.Enum;
using System;
using System.Collections.Generic;

namespace IOA.MES.PdaApi.Models.Response.Oba
{
    public class QueryObasResponse
    {
        /// <summary>
        /// OBA检测列表
        /// </summary>
        public List<Oba> Obas { get; set; } = new List<Oba>();
    }

    public class Oba
    {
        /// <summary>
        /// OBA单号
        /// </summary>
        public string ObaNo { get; set; }

        /// <summary>
        /// 订单号
        /// </summary>
        public string OrderNo { get; set; }

        /// <summary>
        /// 创建人
        /// </summary>
        public string CNCreateBy { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime CreateTime { get; set; }

        /// <summary>
        /// 检测状态
        /// </summary>
        public ObaStatus Status { get; set; }

        /// <summary>
        /// 检测状态
        /// </summary>
        public string CNStatus { get { return !System.Enum.IsDefined(typeof(ObaStatus), Status) ? string.Empty : EnumConvert.ToDesc(Status); } }

        /// <summary>
        /// 完成时间
        /// </summary>
        public DateTime? FinishTime { get; set; }

        /// <summary>
        /// 检测包装
        /// </summary>
        public List<ObaPack> Packs { get; set; } = new List<ObaPack>();

        /// <summary>
        /// 过站列表
        /// </summary>
        public List<ObaSite> Sites { get; set; } = new List<ObaSite>();
    }

    public class ObaPack
    {
        /// <summary>
        /// 打包批次号
        /// </summary>
        public string PackBatchNo { get; set; }

        /// <summary>
        /// 打包编号
        /// </summary>
        public string PackNo { get; set; }
    }

    public class ObaSite
    {
        /// <summary>
        /// 站点
        /// </summary>
        public SiteType SiteType { get; set; }

        /// <summary>
        /// 站点名称
        /// </summary>
        public string CNSiteType { get { return !System.Enum.IsDefined(typeof(SiteType), SiteType) ? string.Empty : EnumConvert.ToDesc(SiteType); } }
    }
}
